<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = new Array(5)
        console.log(arr[0]) //undefined
        console.log(arr.hasOwnProperty(0)) //false

        let obj ={
            name:'葫芦娃'
        }
        let obj2 ={
            skill:'喷火'
        }
        obj.__proto__ = obj2
        console.log(obj.skill) //喷火 原型链查找 原型链继承 继承的是对象的属性和方法，而不是对象的实例
        for(let key in obj){
            console.log(obj[key]) 
        }
        console.log(
            obj.hasOwnProperty('name'),
            obj.hasOwnProperty('skill')
        )
    </script>
</body>

</html>